class BuYaoAComTagLib {
    
	//static namespace = "kis"
	
	/**
	*	e.g.:
	*	<g:formatDate date="${myDate}" format="yyyy-MM-dd" />
	*	
	*/
	def formatDate = {attrs  ->
		def tmpDate = attrs.get('date')
		if (!tmpDate){
			tmpDate = new Date()
		}
		def tmpFmt = attrs.get('format')
		if (!tmpFmt) {
			tmpFmt = "yyyy-MM-dd HH:mm:ss"
		}		
		out << new java.text.SimpleDateFormat(tmpFmt).format(tmpDate)
	}
    
//class end.
}
